const state = {
  userName: '',
  tabBarHeight: 0,
  navBarHeight: 0,
}
const mutations = {
  SET_USER_NAME(state, name) {
    state.userName = name
  },

  SET_TAB_BAR(state, height) {
    state.tabBarHeight = height
  },

  SET_NAV_BAR(state, height) {
    state.navBarHeight = height
  },
}
const actions = {
  // 设置name
  setUserName({ commit }, name) {
    commit('SET_USER_NAME', name)
  },
  // 设置tabBar高度
  setTabBar({ commit }, { height }) {
    commit('SET_TAB_BAR', height)
  },
  // 设置navBar高度
  setNavBar({ commit }, { height }) {
    commit('SET_NAV_BAR', height)
  }
}
export default {
  state,
  mutations,
  actions
}
